<?php
namespace app\index\controller;
use think\Controller;

class Contact extends Controller
{
	public function index()
    {
        return $this->fetch();
    }
    
    public function question()
    {
    	return $this->fetch();
    }
    
    public function save()
    {
 		//print_r($_POST);
 		//print_r(input('post.'));
 		//print_r(request()->post());
 		$data = input('post.');
// 		$validate = validate('Contact');
// 		if(!$validate->scene('add')->check($data)){
// 			$this->error($validate->getError());
// 		}
 		//把$data 提交model层
 		$res = model('Contact')->add($data);
 		if($res){
 			$this->success('发送成功！');
 		}else{
 			$this->error('发送失败！');
 		}
    }
}